import { createApp } from 'vue';
import App from './App.vue'
import router from './router'
import store from './store'
import { ActionBar, ActionBarIcon, ActionBarButton, Divider, Popup, Overlay, Loading, Dialog, ContactCard, Form, AddressEdit, AddressList, Field, CellGroup, Cell, SwipeCell, Icon, Stepper, Card, Checkbox, CheckboxGroup, Button, Swipe, SwipeItem, PullRefresh, List, Tab, Tabs, SubmitBar, Toast } from 'vant'
import 'vant/lib/index.css'
// px2rem 自适应
import 'lib-flexible/flexible'
const app = createApp(App) // 创建实例
// 全局过滤器
app.config.globalProperties.$filters = {
    prefix(url) {
        if (url && url.startsWith('http')) {
            return url
        } else {
            url = `http://47.99.134.126:28019${url}`
            return url
        }
    }
}
app.use(ActionBarButton).use(ActionBarIcon).use(ActionBar).use(Divider).use(Popup).use(Overlay).use(Loading).use(Dialog).use(Toast).use(ContactCard).use(Form).use(AddressEdit).use(AddressList).use(Field).use(CellGroup).use(Cell).use(SwipeCell).use(Icon).use(Stepper).use(Card).use(Button).use(Swipe).use(SwipeItem).use(PullRefresh).use(List).use(Tab).use(Tabs).use(SubmitBar).use(Checkbox).use(CheckboxGroup)
app.use(router).use(store)

app.mount('#app')
